package cn.jinjimi.app.entity;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * Created by Roy
 * Date: 16/9/7
 */
public class ActivityInfo {

    @SerializedName("title")
    public String title;

    @SerializedName("icon")
    public String icon;

    @SerializedName("link")
    public String link;

    @SerializedName("state")
    public String state;

    @SerializedName("data")
    public State data;

    public class State {
        @SerializedName("icon")
        public String icon;

        @SerializedName("link")
        public String link;

        @SerializedName("remark")
        public String remark;

        @SerializedName("title")
        public String title;

        /* 本地推送信息 */
        @SerializedName("alert")
        public List<Alert> alerts;

        /* 是否显示本地推送信息 */
        @SerializedName("alert_state")
        private int alertState;

        public boolean getAlertState() {
            return alertState == 1;
        }
    }

    public class Alert {
        /* 本地推送显示时间 */
        @SerializedName("time")
        public String time;

        /* 提醒结束时间 */
        @SerializedName("end_time")
        public String endTime;

        /* 本地推送显示title */
        @SerializedName("title")
        public String title;

        /* 本地推送显示content */
        @SerializedName("alert")
        public String content;

        /* 本地推送打开url */
        @SerializedName("url")
        public String url;
    }

    @Override
    public String toString() {
        return "ActivityInfo{" +
                "title='" + title + '\'' +
                ", icon='" + icon + '\'' +
                ", link='" + link + '\'' +
                ", state='" + state + '\'' +
                ", data=" + data +
                '}';
    }
}
